Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition in group.set #18796

Merged
merged 1 commit into from Nov 29, 2018
Merged

Fix race condition in group.set #18796

merged 1 commit into from Nov 29, 2018

Conversation

balloob
Copy link
Member

@balloob balloob commented Nov 29, 2018

Description:

Wraps group.set service in an async lock. Group.set contains a few awaits, which can cause a race condition and trying to create a group twice.

Related issue (if applicable): fixes #18636

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@balloob balloob requested a review from a team as a code owner November 29, 2018 20:01
@ghost ghost assigned balloob Nov 29, 2018
@ghost ghost added the in progress label Nov 29, 2018
@balloob balloob added this to the 0.83.1 milestone Nov 29, 2018
await async_setup_component(hass, 'group', {})
component = EntityComponent(_LOGGER, DOMAIN, hass, group_name='yo')

for i in range(2):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for _ in range(2):  # ?

@balloob balloob merged commit 38ecf71 into dev Nov 29, 2018
@delete-merged-branch delete-merged-branch bot deleted the fix-race-group branch November 29, 2018 21:26
@ghost ghost removed the in progress label Nov 29, 2018
balloob added a commit that referenced this pull request Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.83.0b0 - Entity id already exists: group.all_*
4 participants